home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / docs / winer / getcolor.asm < prev    next >
Encoding:
Assembly Source File  |  1992-05-13  |  677 b   |  28 lines

  1. ;GETCOLOR.ASM, retrieves the current COLOR settings
  2.  
  3. ;Copyright (c) 1991 Ethan Winer
  4.  
  5. ;Syntax: CALL GetColor(FG%, BG%)
  6.  
  7.  
  8. .Model Medium, Basic
  9. .Data
  10.   Extrn B$FBColors:Word
  11.  
  12. .Code
  13.  
  14. GetColor Proc, FG:Word, BG:Word
  15.  
  16.   Mov  DX,B$FBColors    ;load the combined colors
  17.   Mov  AL,DL            ;copy the foreground portion
  18.   Cbw                   ;convert it to a full word
  19.   Mov  BX,FG            ;get the address for FG%
  20.   Mov  [BX],AX          ;assign FG%
  21.   Mov  AL,DH            ;load the background portion
  22.   Mov  BX,BG            ;get the address for BG%
  23.   Mov  [BX],AX          ;assign BG%
  24.   Ret                   ;return to BASIC
  25.  
  26. GetColor Endp
  27. End
  28.